﻿using System.IO;
using System.Text;
using FluentExport.CSVExport;
using NUnit.Framework;
using Should.Fluent;

namespace FluentExport.Tests.CSVExportTests
{
    [TestFixture]
    public class CSVTests
    {
        [Test]
        public void MustGetStringFromStreamCorrectly()
        {
            const string strRet = "A,B,C,D\r\nValue1,Value2,Value3,Value4\r\n";
            var memStrem = new MemoryStream(Encoding.ASCII.GetBytes(strRet));

            var csv = new CSV { Result = memStrem };

            var ret = csv.ToString();

            ret.Should().Not.Be.NullOrEmpty();
            ret.Should().Equal("A,B,C,D\r\nValue1,Value2,Value3,Value4\r\n");
        }
    }
}
